<?php
/**
 * Created by PhpStorm.
 * User: Dave
 * Date: 2018/5/29
 * Time: 11:32
 */

use Biz\service\SmallEnergy as sSmallEnergy;
/**
 * @deprecated
 */
class GetMerchantInfoAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_REGISTER;

    public function main()
    {

        $groupIds = $this->getRequest()->getQuery('group_ids', '');
        $groupId = $this->getRequest()->getQuery('group_id', '');//json格式数据
        if (!$groupIds && $groupId) {
            $groupIds = json_decode($groupId, true);
        }
        if (!$groupIds) {
            throw new \Exception('接待组id不能为空');
        }
        $merchantInfo = sSmallEnergy::getmerchantInfo($groupIds);
        $merchantInfo = $merchantInfo ?: [];

        $this->setSuccess($merchantInfo);
    }
}